import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/styles/index.scss' // global css
import './assets/icons' // icon
import "./core.js"

import {
  setRoleRoute
} from './router/routerConfig';

Vue.use(ElementUI);
Vue.config.productionTip = false

document.title = process.env.VUE_APP_TITLE;

async function init() {
  // await store.dispatch("user/GetOfficesList");
  await store.dispatch('user/setGlobalConfig');
  await setRoleRoute();
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app')
}

init();